package com.cin.cma.client.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.Assert;


@Data
@Configuration
@ConfigurationProperties(prefix = "system.config")
@EnableConfigurationProperties(OpenConfig.class)
public class OpenConfig {
    /**
     * 主进程名称
     */
    private String mainPro;
    /**
     * 请求地址
     */
    private String uri;
    /**
     * 签名密钥KEY
     */
    private String signKey;
    /**
     * 签名密钥SECRET
     */
    private String signSecret;

    public void validate() {
        Assert.notNull(this.uri, "uri is null");
        Assert.notNull(this.signKey, "signKey is null");
        Assert.notNull(this.signSecret, "signSecret is null");
    }
}
